<!--///////////////////////////////////////////////////////////
//                         _ooOoo_                           //
//                        o8888888o                          //
//                        88" . "88                          //
//                        (| ^_^ |)                          //
//                        O\  =  /O                          //
//                     ____/`---'\____                       //
//                   .'  \\|     |//  `.                     //
//                  /  \\|||  :  |||//  \                    //
//                 /  _||||| -:- |||||-  \                   //
//                 |   | \\\  -  /// |   |                   //
//                 | \_|  ''\---/''  |   |                   //
//                 \  .-\__  `-`  ___/-. /                   //
//               ___`. .'  /--.--\  `. . ___                 //
//             ."" '<  `.___\_<|>_/___.'  >'"".              //
//           | | :  `- \`.;`\ _ /`;.`/ - ` : | |             //
//           \  \ `-.   \_ __\ /__ _/   .-` /  /             //
//     ========`-.____`-.___\_____/___.-`____.-'========     //
//                          `=---='                          //
//     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^     //
//          佛祖保佑         永无BUG         永不修改        //
///////////////////////////////////////////////////////////////-->
<!--余生网络信息 酷享云支付系统 作者：余生 QQ：2316803263 盗版必究 购买正版请联系作者 盗版有风险-->
<?php
/**
 * 登录
**/
//php防注入和XSS攻击通用过滤.
$is_defend=true;
include("../includes/common.php");

$_GET     && SafeFilter($_GET);
$_POST    && SafeFilter($_POST); 
$_COOKIE  && SafeFilter($_COOKIE);
if(isset($_POST['user']) && isset($_POST['pass'])){
	$user=daddslashes($_POST['user']);
	$pass=md5(daddslashes($_POST['pass']));
	$userrow=$DB->query("SELECT * FROM pay_user WHERE name='{$user}' limit 1")->fetch();
	if($user==$userrow['name'] && $pass==$userrow['pwd']) {
		if($user_id=$_SESSION['Oauth_alipay_uid']){
			$DB->exec("update `pay_user` set `alipay_uid` ='$user_id' where `name`='$user'");
			unset($_SESSION['Oauth_alipay_uid']);
		}
		if($qq_openid=$_SESSION['Oauth_qq_uid']){
			$DB->exec("update `pay_user` set `qq_uid` ='$qq_openid' where `name`='$user'");
			unset($_SESSION['Oauth_qq_uid']);
		}
		$city='';
		$DB->query("insert into `panel_log` (`uid`,`type`,`date`,`city`,`data`) values ('".$user."','登录用户中心','".$date."','".$city."','".$clientip."')");
		$session=md5($user.$pass.$password_hash);
		$expiretime=time()+604800;
		$token=authcode("{$user}\t{$session}\t{$expiretime}", 'ENCODE', SYS_KEY);
		setcookie("user_token", $token, time() + 604800);
		@header('Content-Type: text/html; charset=UTF-8');
		exit("<script language='javascript'>alert('登录用户中心成功！');window.location.href='./';</script>");
	}else {
		@header('Content-Type: text/html; charset=UTF-8');
	 exit("<script language='javascript'>alert('用户名或密码不正确！');history.go(-1);</script>");
  
	}  
}elseif(isset($_GET['logout'])){
	setcookie("user_token", "", time() - 604800);
    setcookie("safecode", "", time() - 604800);
	@header('Content-Type: text/html; charset=UTF-8');
	exit("<script language='javascript'>alert('您已成功注销本次登录！');window.location.href='./login.php';</script>");
}elseif($islogin2==1){
	exit("<script language='javascript'>alert('您已登录！');window.location.href='./';</script>");
}
if($conf['user_kai']==1)sysmsg($conf['user_kail']);

?>


<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo $conf['web_name']?>-会员中心登陆</title>
<meta name="keywords" content="<?php echo $conf['web_name']?>,彩虹易支付,,<?php echo $conf['web_name']?>,云支付,免签约支付接口" />
    <meta name="description" content="<?php echo $conf['web_name']?> 酷享云支付" />
    <link href="/user/login/css/backend.min.css?v=442212212" rel="stylesheet">
    <link rel="stylesheet" href="/user/login/css/bootstrap.min.css">
    <link rel="stylesheet" href="/user/login/css/icons.css">
    <link rel="stylesheet" href="/user/login/css/main.css">
    <link rel="stylesheet" href="/user/login/css/responsive.css">
    <link rel="stylesheet" href="/user/login/layui/css/layui.css">
    <link rel="stylesheet" href="/user/login/fontspay/iconfont.css">
    <style type="text/css">
      .container a {
          color: white!important;
        }
        .container p{
          color: white!important;
        }
        .msg-box {
            display: none!important;
        }
    </style>
</head>
<body>
<div class="account-user-sec" style="background-image: url(/user/login/images/2f5bb2f5ef0e64eaf82a59f271dd0018.jpg);">
  <div class="account-sec">
    <div class="account-top-bar"  style="color:white">
        <div class="container">
            <div class="logo">
              <a href="javascript:void(0)" title="" ><i class="fa fa-bullseye" style="color: white"></i> <?php echo $conf['web_name']?></a>
                  </div>
            <ul class="account-header-link">
              <li><a title="" href="http://wpa.qq.com/msgrd?v=3&uin=<?php echo $conf['web_qq']?>&site=qq&menu=yes"><b>客服QQ：<?php echo $conf['web_qq']?></b></a></li>
            <li><a title="" href="./reg.php"><b>注册</b></a></li>
            <li><a class="btn-forgot" href="findpwd.php"><b>忘记密码？</b></a></li>
            </ul>
           </div>
          </div>
   

   <?php if ( is_mobile() ) { ?>
      <div class="acount-sec">
         <div class="container">
             <div class="row">
                  <div class="col-md-2">
                    </div>
                 <div class="col-md-8">
                    <div class="contact-sec">
                    <div class="row">
                      <div class="col-md-6">   
                      <div class="widget-title">
                      <h3>Login</h3>
                        </div>
                        <div class="account-form">
                      <form name="form" id="login-form" method="POST" action="login.php">
                                <div class="row">
                          <div class="feild col-md-12">
                      <input type="text" id="user" placeholder="手机号码" name="user" autocomplete="off" value="" data-rule="required;" />
                          </div>
                          <div class="feild col-md-12">
                        <input type="password" id="pd-form-password" placeholder="密码" name="pass" autocomplete="off" value="" data-rule="required;" />
                        </div>
                      <div class="feild col-md-12">
                     <button type="submit" style="width: 100%;margin-top: 13px;background: #3c3c3c none repeat " />立即登陆</button>
                      </div>
                      </div>
                     </form>
                    </div>
  
                  </div>
                    <div class="col-md-6">
                    <div class="creat-an-account" style="margin-top: 10px;">
                     <span style="text-align: center;">OR</span>
                   <a href="./reg.php" style="background: #10b5e8 none repeat ;width: 50%;text-align: center;margin-top: 10px;"><i class="fa fa-plus" style=""></i> 点击注册</a>

                  <?php if ($conf['quicklogin']==1) {
                    echo '<a href="oauth.php" style="width: 50%;text-align: center;margin-top: 10px;"><span class="iconfont" style="background: #4e8deb;">&#xe60a;</span>支付宝登陆</a>';
                }elseif ($conf['quicklogin']==2) {
                  echo '<a href="connect.php" style="width: 50%;text-align: center;margin-top: 10px;"><i class="fa fa-qq" style="background: #4e8deb;"></i>QQ登陆</a>';
                }else{
                  echo '<a href="oauth.php" style="width: 50%;text-align: center;margin-top: 10px;"><span class="iconfont" style="background: #4e8deb;">&#xe60a;</span>支付宝登陆</a>';
                }
                  ?>
                 </div>
                    </div>
                        </div>
                                   </div>
                              </div>
                         </div>
                    </div>
               </div>
                    
             <footer style="margin-top: 10px;padding-left: 0px;">
              <div class="container">
                  <p><?php echo $conf['ban']?><i class="fa fa-heart"></i><script type="text/javascript"></script></p>
              </div>
          </footer>
     </div>
</div>
</body>
</html>
  <?PHP }else{  ?>
   <div class="acount-sec">
         <div class="container">
             <div class="row">
                  <div class="col-md-2">
                    </div>
                 <div class="col-md-8">
                    <div class="contact-sec">
                    <div class="row">
                      <div class="col-md-6">   
                      <div class="widget-title">
                      <h3>Login</h3>
                        </div>
                        <div class="account-form">
                      <form name="form" id="login-form" method="POST" action="login.php">
                                <div class="row">
                          <div class="feild col-md-12">
                      <input type="text" id="user" placeholder="手机号码" name="user" autocomplete="off" value="" data-rule="required;" />
                          </div>
                          <div class="feild col-md-12">
                        <input type="password" id="pd-form-password" placeholder="密码" name="pass" autocomplete="off" value="" data-rule="required;" />
                        </div>
                      <div class="feild col-md-12">
                     <button type="submit" style="width: 100%;margin-top: 13px;background: #3c3c3c none repeat " />立即登陆</button>
                      </div>
                      </div>
                     </form>
                    </div>
                  <div class="more-option" >
                  <span style="text-align: center;">OR</span>
                  </div>
                  </div>
                    <div class="col-md-6">
                    <div class="creat-an-account" style="">
                   <span>还没有账号？</span>
                   <a href="./reg.php" style="background: #10b5e8 none repeat ;"><i class="fa fa-plus" style=""></i> 点击注册</a>

                
                   <h4>更多方式</h4>
                     <ul>
                   <?php if ($conf['quicklogin']==1) {
                    echo '<li><a href="oauth.php" title=""><span class="iconfont" style="background: #4e8deb;">&#xe60a;</span></a></li>';
                }elseif ($conf['quicklogin']==2) {
                  echo '<li><a href="connect.php" title=""><i class="fa fa-qq" style="background: #4e8deb;"></i></a></li>';
                }else{
                  echo '<li><a href="oauth.php" title=""><span class="iconfont" style="background: #4e8deb;">&#xe60a;</span></a></li>';
                }
             ?>
                 </ul>
                 </div>
                    </div>
                        </div>
                                   </div>
                              </div>
                         </div>
                    </div>
               </div>
                    
          <footer style="margin-top: 10px;padding-left: 0px;">
              <div class="container">
                  <p><?php echo $conf['ban']?>Ltd.  Made with <i class="fa fa-heart"></i><script type="text/javascript"></script></p>
              </div>
          </footer>
     </div>
</div>
</body>
</html>
<?PHP } ?>
     